<?php
/**
 * 轻云网络验证系统
 * =======================================================
 * 版权所有(C) 2019-2039 daenx.cn，并保留所有权利。
 * 作者：Daen大恩
 * 作者QQ: 1330166565
 * 开发群：661059773
 * =======================================================
 */
 
	header('content-type:text/html;charset=utf-8');
    include 'farmwork.php';
	$username = $_POST['username'];
	$password = $_POST['password'];
	$ycp = $_POST['ycp'];
	$sql = "select * from daili where domain='$username' and pass='$password' and ycp='$ycp'";
	$result = mysqli_query($con,$sql);
	if($result && mysqli_num_rows($result)>0){
		$data=mysqli_fetch_array($result);
		if($data['yumi']=="1")
		{echo("<script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/js/jquery.min.js\"></script><script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/layer/layer.js\"></script><script>layer.open({  type: 1  ,title: false   ,closeBtn: false  ,area: '200px;'  ,shade: 0.8  ,id: 'LAY_layuipro'   ,resize: false  ,btn: ['返回']  ,moveType: 1   ,content: '<div style=\"padding: 30px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;\">你已被平台封禁<br>原因：".$data['bz']."</div>'  ,success: function(layero){ var btn = layero.find('.layui-layer-btn');  btn.find('.layui-layer-btn0').attr({ href: '../$site_name' });  }});</script>");
		exit();}
		else{
		
		$_SESSION['user_username']=$data['domain'];
		$_SESSION['user_uid']=$data['id'];
		$_SESSION['user_email']=$data['email'];
		$_SESSION['user_time']=$data['lotime'];
		$_SESSION['user_ip']=$data['login'];
		setcookie(session_name(),session_id(),time()+604800);
		echo "<script>window.location.href='../user/index.php'</script>";
		exit();}
	}else{
		echo("<script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/js/jquery.min.js\"></script><script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/layer/layer.js\"></script><script>layer.open({  type: 1  ,title: false   ,closeBtn: false  ,area: '200px;'  ,shade: 0.8  ,id: 'LAY_layuipro'   ,resize: false  ,btn: ['返回']  ,moveType: 1   ,content: '<div style=\"padding: 30px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;\">账号或密码错误！</div>'  ,success: function(layero){ var btn = layero.find('.layui-layer-btn');  btn.find('.layui-layer-btn0').attr({ href: '../$site_name' });  }});</script>");
		exit();
	}
?>
